/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

&spmi_bus {
	qcom,pm8226@1 {
		qcom,leds@d300 {
			compatible = "qcom,leds-qpnp";
			status = "okay";
			reg = <0xd300 0x100>;
			label = "flash";
			pm8226_flash0: qcom,flash_0 {
				qcom,max-current = <1000>;
				qcom,default-state = "off";
				qcom,headroom = <3>;
				qcom,duration = <1280>;
				qcom,clamp-curr = <1000>;
				qcom,startup-dly = <3>;
				qcom,safety-timer;
				label = "flash";
				linux,default-trigger =
					"flash0_trigger";
				qcom,id = <1>;
				linux,name = "led:flash_0";
				qcom,current = <800>;
			};

			pm8226_torch: qcom,flash_torch {
				qcom,max-current = <200>;
				qcom,default-state = "off";
				linux,default-trigger =
						"torch_trigger";
				label = "flash";
				qcom,id = <1>;
				linux,name = "led:flash_torch";
				qcom,current = <75>;
				qcom,torch-enable;
			};
		};
	};
};

&soc {

	led_flash0: qcom,camera-led-flash {
		cell-index = <0>;
		compatible = "qcom,camera-led-flash";
		qcom,flash-type = <1>;
		qcom,flash-source = <&pm8226_flash0>;
		qcom,torch-source = <&pm8226_torch>;
	};

};

&cci {
	/*dummy actuator node to satify mm-camera AF capabilities*/
        actuator1: qcom,actuator@0 {
                cell-index = <1>;
                reg = <0x0>;
                compatible = "qcom,actuator";
                qcom,cci-master = <0>;
        };

	qcom,camera@0 {
		cell-index = <0>;
		compatible = "qcom,camera";
		reg = <0x0>;
		qcom,csiphy-sd-index = <0>;
		qcom,csid-sd-index = <0>;
		qcom,led-flash-src = <&led_flash0>;
		qcom,actuator-src = <&actuator1>;
		cam_vdig-supply = <&pm8226_l26>;
		cam_vaf-supply = <&pm8226_l28>;
		qcom,cam-vreg-name ="cam_vdig", "cam_vio", "cam_vaf";
		qcom,cam-vreg-type = <0 0 0>;
		qcom,cam-vreg-min-voltage = <1225000 0 2800000>;
		qcom,cam-vreg-max-voltage = <1225000 0 2800000>;
		qcom,cam-vreg-op-mode = <1225000 0 2800000>;
		qcom,gpio-no-mux = <0>;
		gpios = <&msmgpio 26 0>,
				<&msmgpio 37 0>,
				<&msmgpio 0 0>,
				<&msmgpio 114 0>,
				<&msmgpio 112 0>,
				<&msmgpio 28 0>,
				<&msmgpio 34 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-standby = <2>;
		qcom,gpio-ext-camio-en = <3>;
		qcom,gpio-ext-vana-power = <4>;
		qcom,gpio-vt-reset = <5>;
		qcom,gpio-vt-standby = <6>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4 5 6>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK" , "CAM_RESET" , "CAM_STBY" , "CAM_IO_EN" , "CAM_ANALOG_EN", "VT_RESET", "VT_STANDBY";
		qcom,cci-master = <0>;
		status = "ok";
	};

	qcom,camera@2 {
		cell-index = <2>;
		compatible = "qcom,camera";
		reg = <0x2>;
		qcom,csiphy-sd-index = <1>;
		qcom,csid-sd-index = <1>;
		cam_vdig-supply = <&pm8226_l26>;
		qcom,cam-vreg-name ="cam_vdig","cam_vio";
		qcom,cam-vreg-type = <0 0>;
		qcom,cam-vreg-min-voltage = <1250000 0>;
		qcom,cam-vreg-max-voltage = <1250000 0>;
		qcom,cam-vreg-op-mode = <1250000 0>;
		qcom,gpio-no-mux = <0>;
		gpios = <&msmgpio 26 0>,
				<&msmgpio 37 0>,
				<&msmgpio 0 0>,
				<&msmgpio 114 0>,
				<&msmgpio 112 0>,
				<&msmgpio 28 0>,
				<&msmgpio 34 0>;
		qcom,gpio-reset = <1>;
		qcom,gpio-standby = <2>;
		qcom,gpio-ext-camio-en = <3>;
		qcom,gpio-ext-vana-power = <4>;
		qcom,gpio-vt-reset = <5>;
		qcom,gpio-vt-standby = <6>;
		qcom,gpio-req-tbl-num = <0 1 2 3 4 5 6>;
		qcom,gpio-req-tbl-flags = <1 0 0 0 0 0 0>;
		qcom,gpio-req-tbl-label = "CAMIF_MCLK" , "CAM_RESET" , "CAM_STBY" , "CAM_IO_EN" , "CAM_ANALOG_EN", "VT_RESET", "VT_STANDBY";
		qcom,cci-master = <0>;
		status = "ok";
	};
};
